package ClassWork.Work_01;

import java.util.Scanner;

public class NumberReverse {
    public static void print(){
        int[] arr = reverse();
        for(int i = 0; i < arr.length; i++){
            System.out.print(arr[i] + " ");
        }
    }
    public static int[] reverse() {
        int[] arr = scanner();
        for(int i = 0; i < arr.length / 2; i++){
            int temp = arr[i];
            arr[i] = arr[arr.length - i - 1];
            arr[arr.length - i - 1] = temp;
        }
        return arr;
    }
    public static int[] scanner(){
        Scanner sc = new Scanner(System.in);
        System.out.println("输入数组长度：");
        int length = sc.nextInt();
        System.out.println("输入数组：");
        int[] arr = new int[length];
        for(int i = 0; i < length; i++){
            arr[i] = sc.nextInt();
        }
        return arr;
    }
    public static void main(String[] args){
        print();
    }
}
